package GoldMiner.com.ALi;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;

/**
 * @author ：ALi
 * @date ：Created in 2021/10/31 10:29
 * @description：石块和金块的公共属性类
 * @modified By：
 * @version: $
 */
public class Object {
    //坐标
    protected int x;
    protected int y;
    //宽高
    protected int width;
    protected int height;
    //图片
    protected Image img;
    //标记是否移动 0:不可以移动
    protected boolean flag;
    //质量属性
    protected int m;
    //积分
    protected int count;
    //类型:1 is glod,2 is rock
    protected int type;

    void PaintLump(Graphics graphics){
        graphics.drawImage(img,x,y,null);
    }

    //获取矩阵的宽
    public int getWidth() {
        return width;
    }
    //获取矩形
    public Rectangle getRec(){
        return new Rectangle(x,y,width,height);
    }

}